package com.zpark.service.impl;

import com.zpark.mapper.IUserMapper;
import com.zpark.pojo.User;
import com.zpark.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @PackageName: com.zpark.service.impl
 * @ClassName: UserServiceImpl
 * @Description:
 * @author: RZS
 * @date: 2024/4/28  8:37
 */
//@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private IUserMapper userMapper;

    @Override
    public User findById(Integer id) {

        return userMapper.selectById(id);
    }

    @Override
    public List<User> findAll() {

        // 演示BaseMapper常用方法
        // userMapper.insert(User)  添加数据
        // userMapper.updateById() 根据ID修改数据
        // userMapper.update() 根据字段属性修改数据

        return userMapper.selectList(null);
    }
}
